<style type="text/css">
.default {
	margin-bottom:10px;
}
.default tr th, .default tr td {
	padding:1px 10px;
	font-size: small; 
}
.default tr th {
	background:#8D0000 url('/images/penjaga_button.png') repeat-x scroll top left;
	color:#ffffff;
}
</style>
 
<%= render :partial => "submenu" %>
 
<%= error_messages_for 'usergroup' %>
<% if flash[:message] %> 
		<p style="color: blue;"><%= flash[:message] %></p>
<% end %>
<% if flash[:warning] %> 
	<p style="color: red;"><%= flash[:message] %></p>
<% end %>
<% if flash[:dbnotsycn] %> 
		<p style="color: blue; background: #fff000"><%= flash[:dbnotsycn] %></p>
			ACL list in your Database is not Syncronize with the Controller.
			You Need to update the list in your Database.<br>
			Click Button Bellow
			<% form_for :group, :url=>{:action => 'paddingAclTable'} do |f| %>			
				<%= submit_tag "Update ACL" %>				
			<% end %>
<% end %>

<h3>Manage Group Members</h3>

<% form_for :group, :url=>{:action => 'manage_member'} do |f| %>
	<label>Select Group From The List</label> :
	<%= select("group", "id", @groups.collect {|p| [ p.name, p.id ] },{:include_blank => '[Select Group]'}, {:selected => @groupId.to_i}) %>
	<%= submit_tag "Refresh" %>
<% end %>

<% if !@group.nil? and !@group.id.nil? %>
	<% form_for :group, :url=>{:action => 'update_member'} do |form| %>
		<%= form.hidden_field "id", :size => 20, :value => @groupId %><br/>
		<table class="default" border=1>
			<tr>
				<th align=center  > Users </th> <th align=center  > Members of <%= @group.name %> </th>
			</tr>
			<% @users.each{|user| %>
				<tr>
				<% status = ' (not active)'
					status = ' (active)' if user.active == true 
					strUser = user.login + status %>
				<td align=center ><%= link_to strUser, {:action => "user_show" , :id => user.id } %>   </td>
				<td align=center>
				<%= check_box_tag "member["+user.login+"]", user.id.to_s , @hashMember[user.id] %> 
				 </td>
				</tr>

			<% } %>
		</table>
		<%= submit_tag "Submit" %>
	<% end %>
	
<% end %>

<div style="font-size:x-small;color:white">Greet jijan@https://gallus.honeynet.org.my/</div>
